import { Column, Entity, ManyToOne } from 'typeorm'
import { DiscordID } from '@boticord/common'
import { User } from '@boticord/users-client'
import { Resource } from '@boticord/resources-client'

export enum BoostLevels {
  LevelNone,
  LevelOne,
  LevelTwo,
  LevelThree,
}

// обязательно лвлы писать по возростанию иначе ты сука
export const boostLevelAmount: Record<BoostLevels, number> = {
  [BoostLevels.LevelNone]: 0,
  [BoostLevels.LevelOne]: 1,
  [BoostLevels.LevelTwo]: 2,
  [BoostLevels.LevelThree]: 3,
}

@Entity()
export class ResourceBoost extends DiscordID {
  @ManyToOne(() => User, user => user.boosts)
  declare user: User

  @ManyToOne(() => Resource, resource => resource.boosts)
  declare resource?: Resource

  @Column()
  declare boughtAt: number
}